package com.joinway.framework.site.beans.view;

import java.util.List;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.jsondoc.core.annotation.ApiObject;
import org.jsondoc.core.annotation.ApiObjectField;

import com.joinway.framework.bean.BaseBean;

@ApiObject(name="QueryForm",description="列表查询条件")
public class QueryForm extends BaseBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@NotBlank
	@ApiObjectField(description="要查询的表名")
	private String target;
	
	@Pattern(regexp="\\d+")
	@ApiObjectField(description="页号")
	private String page;
	
	@Pattern(regexp="\\d+")
	@ApiObjectField(description="每页行数")
	private String rows;
	
	@NotEmpty
	@ApiObjectField(description="查询条件")
	private List<QueryCondition> conditions;

	@ApiObjectField(description="排序条件")
	private List<OrderCondition> orderConditions;
	
	public List<QueryCondition> getConditions() {
		return conditions;
	}

	public void setConditions(List<QueryCondition> conditions) {
		this.conditions = conditions;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getPage() {
		return page;
	}

	public void setPage(String page) {
		this.page = page;
	}

	public String getRows() {
		return rows;
	}

	public void setRows(String rows) {
		this.rows = rows;
	}

	public List<OrderCondition> getOrderConditions() {
		return orderConditions;
	}

	public void setOrderConditions(List<OrderCondition> orderConditions) {
		this.orderConditions = orderConditions;
	}
	
}

